package util;

import java.util.Collections;
import java.util.List;

import util.Node.LastNode;

public class PublicVars {
	
	public enum Heuristic{
		DIAGONALSHORTCUT, MANHATTAN, AIRLINE
	}
	
	private static int fieldWidth = 25;
	private static int fieldHeight = 25;
	
	private static int nodeSize = 40;
	private static Node[][] nodeNet = new Node[fieldWidth][fieldHeight];
	
	private static boolean inSetup = true;

	private static int activeMode = 0;
	
	private static float zoom = 1.0f;
	
	private static AStar aStar;
	
	private static Heuristic heuristic = Heuristic.DIAGONALSHORTCUT;


	private static int animSpeed = 1000;
	
	private static List<LastNode> currentPath;
	
	private static boolean pathFindingFinished = false;

	//Getters & Setters
	public static int getFieldWidth() {
		return fieldWidth;
	}

	public static void setFieldWidth(int fieldWidth) {
		PublicVars.fieldWidth = fieldWidth;
	}

	public static int getFieldHeight() {
		return fieldHeight;
	}

	public static void setFieldHeight(int fieldHeight) {
		PublicVars.fieldHeight = fieldHeight;
	}

	public static int getNodeSize() {
		return nodeSize;
	}

	public static void setNodeSize(int nodeSize) {
		PublicVars.nodeSize = nodeSize;
	}

	public static Node[][] getNodeNet() {
		return nodeNet;
	}

	public static void setNodeNet(Node[][] nodeNet) {
		PublicVars.nodeNet = nodeNet;
	}

	public static boolean isInSetup() {
		return inSetup;
	}

	public static void setInSetup(boolean inSetup) {
		PublicVars.inSetup = inSetup;
	}

	public static int getActiveMode() {
		return activeMode;
	}

	public static void setActiveMode(int activeMode) {
		PublicVars.activeMode = activeMode;
	}

	public static float getZoom() {
		return zoom;
	}

	public static void setZoom(float zoom) {
		PublicVars.zoom = zoom;
	}

	public static AStar getaStar() {
		return aStar;
	}

	public static void setaStar(AStar aStar) {
		PublicVars.aStar = aStar;
	}

	public static Heuristic getHeuristic() {
		return heuristic;
	}

	public static void setHeuristic(Heuristic heuristic) {
		PublicVars.heuristic = heuristic;
	}

	public static int getAnimSpeed() {
		return animSpeed;
	}

	public static void setAnimSpeed(int animSpeed) {
		PublicVars.animSpeed = animSpeed;
	}

	public static List<LastNode> getCurrentPath() {
		return currentPath;
	}

	public static void setCurrentPath(List<LastNode> path) {
		Collections.reverse(path);
		PublicVars.currentPath = path;
	}

	public static boolean isPathFindingFinished() {
		return pathFindingFinished;
	}

	public static void setPathFindingFinished(boolean pathFindingFinished) {
		PublicVars.pathFindingFinished = pathFindingFinished;
	}

	
}
